package com.example.comsys.service;

import com.example.comsys.model.Attend;
import com.example.comsys.model.Result;
import com.example.comsys.param.AttendQueryParam;
import java.time.LocalDateTime;
import java.util.List;

/**
 * 员工考勤服务接口
 *
 * @author wjh
 * @date 2019/12/30, 周一
 */
public interface AttendService extends PageQueryService<Attend, AttendQueryParam> {

  /**
   * query attend by query param
   *
   * @param param query param
   * @return attend col
   */
  List<Attend> queryAttendsByParam(AttendQueryParam param);


  /**
   * delete one attend record by primary key
   *
   * @param id primary key
   * @return true if successfully deleted
   */
  boolean deleteAttend(long id);


  /**
   * 增加单个考勤记录
   *
   * @param attend 考勤记录
   * @return 添加结果
   */
  Result<String> addAttendRecord(Attend attend);

  /**
   * 批量增加指定部门所有员工的考勤记录
   *
   * @param departId 部门主键
   * @param startDate 开启日期
   * @param endDay 结束日期
   * @return 操作结果
   */
  Result<String> batchGenerateAttendRecord(long departId, LocalDateTime startDate, int endDay);
}
